From: Michael Tokarev Date: Tue, 20 Jan 2026 19:27:54 +0000 (+0300) Subject: inline getprogname replacement X-Git-Tag: archive/raspbian/2%4.24.1+dfsg-1+rpi1^2~3 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/%22mailto:mocancezar%40gmail.com//%22mailto:i18n-csb%40linuxcsb.org/%22/%22http:/www.example.com/%22mailto:mocancezar%40gmail.com/%22mailto:i18n-csb%40linuxcsb.org/%22?a=commitdiff_plain;h=891e780a6203b44cab9e5a0468b8c850bc011f6e;p=samba.git inline getprogname replacement Forwarded: not-needed Inline getprogname() by using program_invocation_short_name when available (like with glibc). This makes a lot of binaries to avoid linkage to libreplace. This is a short and dirty version, proper change for upstream should clean up #ifdef'fery in replace.c. Gbp-Pq: Name inline-getprogname.diff --- diff --git a/lib/replace/replace.c b/lib/replace/replace.c index 33cbbec1..b0e1edbd 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -1144,7 +1144,7 @@ void *rep_memset_explicit(void *block, int c, size_t size) } #endif -#ifndef HAVE_GETPROGNAME +#if !defined(HAVE_GETPROGNAME) && !defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME) # ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME # define PROGNAME_SIZE 32 static char rep_progname[PROGNAME_SIZE]; diff --git a/lib/replace/replace.h b/lib/replace/replace.h index da5cc5be..9d75ceae 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -1012,9 +1012,13 @@ void *rep_memset_explicit(void *block, int c, size_t size); #endif #ifndef HAVE_GETPROGNAME +#ifdef HAVE_PROGRAM_INVOCATION_SHORT_NAME +# define getprogname() (program_invocation_short_name) +#else #define getprogname rep_getprogname const char *rep_getprogname(void); #endif +#endif #ifndef HAVE_COPY_FILE_RANGE #define copy_file_range rep_copy_file_range